<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateTableKmsClients extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('kms_clients', function (Blueprint $table) {
            $table->id();

            $table->string("icon")->comment("应用icon")->default("");
            $table->string("name")->comment("应用名称")->default("");
            $table->string("desc")->comment("应用描述")->default("");
            $table->tinyInteger("type")->comment("应用分类 0 - app 1 - 原生应用")->default(0);
            $table->tinyInteger("childType")->comment("应用子分类 1 - 夸父相机  2 - 夸父相册")->default(0);
            $table->string("uniAppId")->comment("应用uniAppId")->default("");
            $table->unsignedInteger("clientId")->comment("oauth_clients.id")->default(0);
            $table->unsignedBigInteger("sort")->comment("排序")->default(0);
            $table->tinyInteger("status")->comment("状态 0 - 禁用 1 - 启用")->default(1);


            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->unsignedInteger('isDeleted')->default(0)->comment('是否删除 0 - 正常 1 - 已删除');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = 'kms - 自建应用信息';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('kms_clients');
    }
}
